package model.quadtree.graph;

import java.awt.Point;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

import model.quadtree.Type;


public class MainQuadTree2Graph {
	@SuppressWarnings("rawtypes")
	public static void main(String[] args) {
		Node2Graph root = new Node2Graph(Type.WHITE, new Point(21, 1), new Point(1, 17));
		QuadTree2Graph tree = new QuadTree2Graph(root);
		tree.makeChildren(root);
		List<Rectangle> obstacles = new ArrayList<Rectangle>();
		obstacles.add(new Rectangle(2, 16, 2, 1));
		obstacles.add(new Rectangle(17, 2, 2, 1));
		//obstacles.add(new Rectangle(15, 6, 2, 5));
		tree.verifyGreys(obstacles);
		tree.verifyNeighborhood();
		if(tree.debug()){	
			Enumeration keys = tree.getLeafNodes().keys();
			while(keys.hasMoreElements()){
				System.out.println(keys.nextElement());
			}
		/*	for(Edge edge : tree.getEdges()){
				System.out.println(edge.getA().getId()+" is neighbor of "+edge.getB().getId());
				System.out.println("  Distance: "+edge.getDelta());
			}*/
		}
	}
}
